package org.andcool.audio.sound;

import org.andcool.audio.BaseAudioManager;

import android.media.AudioManager;
import android.media.SoundPool;

/**
 * @author Joosun
 * @since 2011-5-29
 */
public class SoundManager extends BaseAudioManager<Sound>
{
	private static final int MAX_SIMULTANEOUS_STREAMS_DEFAULT = 5;

	private final SoundPool mSoundPool;

	public SoundManager()
	{
		this(SoundManager.MAX_SIMULTANEOUS_STREAMS_DEFAULT);
	}

	public SoundManager(final int pMaxSimultaneousStreams)
	{
		this.mSoundPool = new SoundPool(pMaxSimultaneousStreams, AudioManager.STREAM_MUSIC, 0);
	}

	SoundPool getSoundPool()
	{
		return this.mSoundPool;
	}

	@Override
	public void releaseAll()
	{
		super.releaseAll();

		this.mSoundPool.release();
	}
}